package com.nuoniu.sibanyun.entity.finance;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 会计凭证主表
 * </p>
 *
 * @author 小啊刚
 * @since 2021-04-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("fag_voucher")
@ApiModel(value="VAccountingVoucherMain对象", description="会计凭证主表")
public class VAccountingVoucherMain extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "会计年份")
    @TableField("account_year")
    private Integer accountYear;

    @ApiModelProperty(value = "账套期间")
    @TableField("account_period")
    private Integer accountPeriod;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "编号")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "编号")
    @TableField("number")
    private Integer number;

    @ApiModelProperty(value = "凭证类别id")
    @TableField("v_class_id")
    private Integer vClassId;

    @ApiModelProperty(value = "凭证类别名称")
    @TableField("v_class_name")
    private String vClassName;

    @ApiModelProperty(value = "凭证字")
    @TableField("class_word")
    private String classWord;

    @ApiModelProperty(value = "合同号")
    @TableField("contract_no")
    private String contractNo;

    @ApiModelProperty(value = "附单据数")
    @TableField("attached_data")
    private String attachedData;

    @ApiModelProperty(value = "状态1:已审0:未审")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "是否作废0:否1:是")
    @TableField("is_delete")
    private Integer isDelete;

    @ApiModelProperty(value = "业务日期")
    @TableField("business_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate businessDate;

    @ApiModelProperty(value = "创建日期")
    @TableField("create_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate createDate;

    @ApiModelProperty(value = "创建人姓名")
    @TableField("create_user_name")
    private String createUserName;

    @ApiModelProperty(value = "创建人id")
    @TableField("create_user_id")
    private Integer createUserId;

    @ApiModelProperty(value = "修改日期")
    @TableField("update_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate updateDate;

    @ApiModelProperty(value = "修改人姓名")
    @TableField("update_user_name")
    private String updateUserName;

    @ApiModelProperty(value = "修改人id")
    @TableField("update_user_id")
    private Integer updateUserId;

    @ApiModelProperty(value = "审核人ID")
    @TableField("reviewer_user_id")
    private Integer reviewerUserId;

    @ApiModelProperty(value = "审核人姓名")
    @TableField("reviewer_user_name")
    private String reviewerUserName;

    @ApiModelProperty(value = "审核时间")
    @TableField("reviewer_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate reviewerDate;

    @ApiModelProperty(value = "记账人id")
    @TableField(value = "bookkeeper_id")
    private Integer bookkeeperId;

    @ApiModelProperty(value = "记账人姓名")
    @TableField(value = "bookkeeper_name")
    private String bookkeeperName;

    @ApiModelProperty(value = "记账日期")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH-mm-ss" )
    @TableField(value = "book_date")
    private LocalDateTime bookDate;

    @ApiModelProperty(value = "来源单id")
    @TableField("source_voucher_id")
    private Integer sourceVoucherId;

    @ApiModelProperty(value = "来源单号")
    @TableField("source_voucher_code")
    private String sourceVoucherCode;

    @ApiModelProperty(value = "来源日期")
    @TableField("source_voucher_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate sourceVoucherDate;

    @ApiModelProperty(value = "来源单据类型")
    @TableField("source_voucher_type")
    private String sourceVoucherType;

    @ApiModelProperty(value = "摘要")
    @TableField(exist = false)
    private String description;

    @ApiModelProperty(value = "借方金额")
    @TableField(exist = false)
    private BigDecimal debitAmount;

    @ApiModelProperty(value = "贷方金额")
    @TableField(exist = false)
    private BigDecimal creditAmount;

    @ApiModelProperty(value = "明细列表")
    @TableField(exist = false)
    private List<VAccountingVoucherDetail> accountingVoucherDetails;

}
